package com.qd.panda.etc.dto.resp;

import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * 验证授权返回结果
 *
 * @author sjk
 */
@Data
@Accessors(chain = true)
@ToString
public class ValidateResponseDTO{
    private static final Integer VALIDATION_SUCCEEDED=1;
    private static final Integer AUTHORIZED=1;

    /**
     * 验证结果 Integer 1-验证通过 2-验证失败 是
     */
    private Integer validateResult;
    /**
     * 授权结果 Integer 1-已授权 2-未授权 否,validateResult=1
     */
    private Integer authResult;
    /**
     * 授权时间 String yyyy-MM-ddTHH:mm:ss 否，authResult=1时
     */
    private String authTime;
    /**
     * 接收时间 String YYYY-MM-DDTHH:mm:ss 是
     */
    private String receiveTime;

    public boolean isValidate(){
        return validateResult.equals(VALIDATION_SUCCEEDED);
    }
    public boolean isAuth(){
        return authResult.equals(AUTHORIZED);
    }
    public void freeData(){
        this.validateResult = null;
        this.authResult = null;
        this.authTime = null;
        this.receiveTime = null;
    }
}